package com.kgc.est.feignService;


import com.kgc.est.dto.UsersDto;
import com.kgc.est.pojo.Users;
import com.kgc.est.request.LoginSmsReq;
import com.kgc.est.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户 服务类
 * </p>
 *
 * @author szq
 * @since 2021-10-19
 */
@FeignClient(value = "est-provider")
public interface UsersService {

    /**
     * 短信验证登录
     * @param loginSmsReq
     * @return
     */
    @PostMapping("/user/loginSms")
    Result<Map<String,Object>> loginSms(@RequestBody LoginSmsReq loginSmsReq);

    /**
     * 根据token获取用户信息
     * @param token
     * @return
     */
    @GetMapping("/user/info")
    Result<UsersDto> info(@RequestParam("token") String token);

    /**
     * 验证用户是否已经使用微信登录过二手兔
     * @param access_token
     * @param openid
     * @return
     */
    @GetMapping("/user/loginWechat")
    Map<String,Object> loginWechat(@RequestParam("access_token") String access_token,@RequestParam("openid") String openid);
}
